package com.taxshare.purchaser.timer;

import com.taxshare.purchaser.service.ElectronicLedgerService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.xxl.job.core.log.XxlJobLogger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @ClassName: InvoiceAuthHandle
 * @Description:
 * @author: luozhongyi
 * @date: 2021/7/14 17:08
 */
@Component
public class InvoiceAuthHandler {

    @Autowired
    ElectronicLedgerService electronicLedgerService;

    @XxlJob("syncInvoice")
    public ReturnT<String> execute(String param) {
        XxlJobLogger.log("专票同步定时任务结束"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        electronicLedgerService.timedDataHandling();
        XxlJobLogger.log("专票同步定时任务结束："+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        return ReturnT.SUCCESS;
    }
}
